﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WF_Business;

public partial class Map_MarkInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["drwingMode"] == "polygon")
            {
                BindDataType();
                BindPurpose();
            }
        }
    }

    private DataTable GetDataTable(string typecode)
    {
        var dtTemp = new DataTable();
        var strSql = string.Format(" select text,value,typename,typecode,num from tb_sjzd where typecode='{0}' order by num ", typecode);
        SysParams.OAConnection().RunSql(strSql, out dtTemp);
        return dtTemp;
    }

    private void BindDataType()
    {
        ddlDataType.DataSource = GetDataTable("DATATYPE");
        ddlDataType.DataTextField = "text";
        ddlDataType.DataValueField = "value";
        ddlDataType.DataBind();
    }

    private void BindPurpose()
    {
        ddlPurpose.DataSource = GetDataTable("PURPOSE");
        ddlPurpose.DataTextField = "text";
        ddlPurpose.DataValueField = "value";
        ddlPurpose.DataBind();
    }
}